Hello Quarto

What is Quarto?

Quarto® is an open-source scientific and technical publishing system built on Pandoc


Quarto integrates what has been learned over the last 10-years from RMarkdown into one system for creating and publishing reproducible documents.

Let’s get started!

  • Open RStudio
  • Click on “File”
  • Select “New File”
  • Select “Quarto Document”
    • Fill in the title and author
    • Select HTML for the format option
  • Click “Create”!

A Quarto Document

---
title: "ggplot2 demo"
author: "Norah Jones"
date: "May 22nd, 2021"
format: 
  html:
    code-fold: true
---

## Air Quality

@fig-airquality further explores the impact of temperature 
  on ozone level.

```{r}
#| label: fig-airquality
#| fig-cap: Temperature and ozone level.
#| warning: false

library(ggplot2)
ggplot(airquality, 
       mapping = aes(x = Temp, y = Ozone)
       ) + 

  geom_point() + 
  geom_smooth(method = "loess"
)
```

Anatomy of a Quarto document


The YAML metadata or header is:

processed in many stages of the rendering process and can influence the final document in many different ways. It is placed at the very beginning of the document and is read by each of Pandoc, Quarto and knitr. Along the way, the information that it contains can affect the code, content, and the rendering process.

  • What editor should be the default for working in the document?
---
editor: visual
---
  • What format should the document render in?
---
format: html
---
  • Are there additional formatting options?
---
format: 
  html:
    code-fold: true
---

Code


```{r}
#| label: species-means
#| tbl-cap: Mean body mass (g) of penguins on Palmer Archipelego
#| warning: false

library(palmerpenguins)

penguins %>%
  drop_na(body_mass_g) %>% 
  group_by(species) %>% 
  summarize(mean_weight = mean(body_mass_g)
            )
```
# A tibble: 3 × 2
  species   mean_weight
  <fct>           <dbl>
1 Adelie          3701.
2 Chinstrap       3733.
3 Gentoo          5076.


{r} – notates what language the code is written in

#| – defines code chunk options

Text

Quarto is based on Pandoc and uses its variation of markdown as its underlying document syntax. Markdown is a plain text format that is designed to be easy to write, and, even more importantly, easy to read


# Heading 1
This is a sentence with some **bold text**, some *italic text* and an [image](image.png).

Text Formatting

Markdown Syntax Output
*italics* and **bold**
italics and bold
superscript^2^ / subscript~2~
superscript2 / subscript2
~~strikethrough~~
strikethrough
`verbatim code`
verbatim code

Headings

Markdown Syntax Output
# Header 1

Header 1

## Header 2

Header 2

### Header 3

Header 3

#### Header 4

Header 4

##### Header 5
Header 5
###### Header 6
Header 6

Your turn!

The exhaustive list of YAML options that can be used for HTML documents can be found here: https://quarto.org/docs/reference/formats/html.

Using this resource add the following to your document:

  • code folding
  • is self-contained
  • center alignment of all figures
  • an execution option which suppresses messages output from R

Afterward, add at least one additional YAML option of your choosing!